﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ProductList.aspx.cs" Inherits="Pages_Admin_ProductList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript"  src="../../JS/datatime.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <fieldset style="width:750px; padding:10px">
<legend>筛选条件</legend>
<label>城市：</label>
      <asp:DropDownList ID="ddlcity" runat="server" DataSourceID="odsCity" 
                        DataTextField="CityName" DataValueField="CityID" >
                    </asp:DropDownList>
                   &nbsp;&nbsp; 销售日期：<asp:TextBox ID="txtkey" onblur="showHint(this,1)" onkeypress="return false"  onselectstart="return false;" onfocus="showHint(this,10,'outDate')" runat="server" Width="80px"></asp:TextBox>
                    产品名称：<asp:TextBox ID="txtProductName" runat="server" ></asp:TextBox>
                  <asp:Button ID="Button1" runat="server" Height="29px" Text="搜索" Width="114px" onclick="Button1_Click" />
                  </fieldset>
    <div style="width:100%; text-align:left;">
<pan:SmartGridView ID="gdvProductlist" runat="server"  Width="800px" 
            AllowPaging="True" AllowSorting="True"  AutoGenerateColumns="False" DataSourceID="odsProductList"
        PageSize="15"  BorderWidth="1px" BackColor="White" 
            BorderColor="#999999" BorderStyle="None" CellPadding="3" 
             GridLines="Vertical" DataKeyNames="ProductID" 
            onrowdeleted="gdvProductlist_RowDeleted" >
         <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
         <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
            <Columns>
                <%--<asp:BoundField DataField="ProductID" Visible="false" />--%>
             <asp:HyperLinkField DataNavigateUrlFields="ProductID" 
                    DataNavigateUrlFormatString="/pages/index.aspx?pid={0}"  Target="_blank"
                    DataTextField="ProductName" HeaderText="产品名称" SortExpression="ProductID" >
                <ItemStyle Width="25%" />
                </asp:HyperLinkField>               
                <asp:BoundField DataField="NowPrice" HeaderText="销售价" DataFormatString="{0:￥.0}"  >
              
                </asp:BoundField>
                <asp:BoundField DataField="ShowDate" DataFormatString="{0:yyyy-MM-dd}" 
                    HeaderText="出售日期">
                  <ItemStyle Width="80px" />
                </asp:BoundField>
                <asp:BoundField DataField="EndDate" DataFormatString="{0:yyyy-MM-dd}" 
                    HeaderText="截至日期">
                  <ItemStyle Width="80px" />
                </asp:BoundField>
                <asp:BoundField DataField="OwnerName" HeaderText="商户名称">
               
                </asp:BoundField>
                <asp:BoundField DataField="OwnerTel" HeaderText="商户电话">
                
                </asp:BoundField>
                 <asp:TemplateField HeaderText="更新图片">
                    <ItemTemplate> 
                    <a onclick="javascript:window.open('Misc/ProductImage.aspx?id=<%# Eval("ProductID") %>', '', 'width=500,height=250,resizable=0,scrollbars=no');" style="cursor:hand; color:Blue">更新图片</a>
                  <%--<a href='Tv_new.aspx?id=<%# Eval("CorpID") %>' target="_blank">ddd</a>--%>
                   </ItemTemplate>
                     <ItemStyle Width="70px" />
                    </asp:TemplateField>
                   <asp:HyperLinkField DataNavigateUrlFields="ProductID" 
                    DataNavigateUrlFormatString="productdetail.aspx?pid={0}" Text="修改"  HeaderText="更新"  >
                <ItemStyle Width="40px" />
                </asp:HyperLinkField>
                 <asp:TemplateField HeaderText="删除">
                    <ItemTemplate>
                        <asp:LinkButton CommandName="Delete" Text="删除" OnClientClick="javascript:return confirm('你确认要删除此商品吗！')" runat="server" ID="delCmd"></asp:LinkButton>
                    </ItemTemplate>
                 </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <EmptyDataTemplate>
        <div style='text-align:left;margin-left:20px;line-height:20px;margin-bottom:10px;'>
		   <p style='color:#FF4E00;font-size:14px;font-weight:bold;'> 抱歉！没有搜索到相关信息 ！<br /><br /></p>
			可能的原因有：<br />
			1、不匹配<br />
			2、没有满足搜索条件的信息。<br /></div>
        </EmptyDataTemplate>
         <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        <CustomPagerSettings PagingMode="Webabcd" TextFormat="每页{0}条/共{1}条  第{2}页/共{3}页   " />
        <PagerSettings Position="Bottom" PageButtonCount="13" FirstPageText="首页" PreviousPageText="上一页"
            NextPageText="下一页" LastPageText="末页" />
         <AlternatingRowStyle BackColor="#DCDCDC" />
         <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
    </pan:SmartGridView>
        </div>
   
    </div>
    <asp:ObjectDataSource ID="odsProductList" runat="server"  SelectMethod="GetListBySearch"  OldValuesParameterFormatString="{0}"  
        TypeName="Tuan.BLL.Products" 
        UpdateMethod="Update" DeleteMethod="Delete">
        <DeleteParameters>
            <asp:Parameter Name="ProductID" Type="Int32" />
        </DeleteParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlcity" Name="cityid" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="txtkey" Name="date" PropertyName="Text" 
                Type="String" />
            <asp:ControlParameter ControlID="txtProductName" Name="productKey" 
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsCity" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllList" 
        TypeName="Tuan.BLL.City"></asp:ObjectDataSource>
    </form>
</body>
</html>
